/*
  @author dmj1161859184@126.com 2018-08-05 13:47
  @version 1.0
  @since 1.0
*/

//Reference: https://juejin.im/post/59658504f265da6c415f3324
let deepCopy = function (obj) {
    //if (typeof obj !== 'object') return; 不应该是下面这个样子吗
    if (typeof obj !== 'object') return obj;
    let newObj = obj instanceof Array ? [] : {};
    for (let key in obj) {
        if (obj.hasOwnProperty(key)) {
            newObj[key] = typeof obj[key] === 'object' ? deepCopy(obj[key]) : obj[key];
        }
    }
    return newObj;
};